﻿@model List<RelaxStoryDataContract>
@using Core.Contract.DataContract
@using www.Controllers
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="content">
    <div class="default-left">
        <div id="NewsAll">
            @if (Model != null)
            {
                foreach (var item in Model)
                {
                <div class="readfun">
                    <div class="imgredstory">
                        <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">
                            <img src="/@item.Image" alt="@item.Name"/>
                        </a>
                    </div>
                    <div class="deinfo">
                        <div class="row name">
                            <h3><b><a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@item.Name</a></b></h3>
                        </div>
                        <div class="content detail-content">
                            @if (item.Decription != null && HttpUtility.HtmlDecode(item.Decription).Length > 80)
                            {
                                <h4>@Html.Raw(HttpUtility.HtmlDecode(item.Decription).Substring(0, 80)) ... </h4> 
                                <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@Utility.GetResource.GetResouceValue(Session["Culture"], "lblWatchDetail")...</a>
                            }
                            else
                            {
                                <h4>@Html.Raw(HttpUtility.HtmlDecode(item.Decription))</h4> 
                                <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@Utility.GetResource.GetResouceValue(Session["Culture"], "lblWatchDetail")...</a>
                            }
                        </div>
                    </div>
                </div>
                }
            }
            else
            {
                @Utility.GetResource.GetResouceMessage(Session["Culture"], "lblEmpty")
            }
        </div>
    </div>
    <div class="default-right">
        <div id="readstory">
            @if (ViewBag.StorySearch != null)
            {
                foreach (var item in (List<RelaxStoryDataContract>)ViewBag.StorySearch)
                {
                <div class="readfun">
                    <div class="imgredstory">
                        <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">
                            <img src="/@item.Image" alt="@item.Name"/>
                        </a>
                    </div>
                    <div class="deinfo">
                        <div class="row name">
                            <h3><b><a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@item.Name</a></b></h3>
                        </div>
                        <div class="content detail-content">
                            @if (item.Decription != null && HttpUtility.HtmlDecode(item.Decription).Length > 250)
                            {
                                <h4>@Html.Raw(HttpUtility.HtmlDecode(item.Decription).Substring(0, 250)) + "..." </h4> 
                                <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@Utility.GetResource.GetResouceValue(Session["Culture"], "lblWatchDetail")...</a>
                            }
                            else
                            {
                                <h4>@Html.Raw(HttpUtility.HtmlDecode(item.Decription))</h4> 
                                <a href="/Home/StoryDetail/@Session["Culture"]/@item.CategoryId/@item.Id/@item.Tag">@Utility.GetResource.GetResouceValue(Session["Culture"], "lblWatchDetail")...</a>
                            }
                        </div>
                    </div>
                </div>
                }
                <div class="watchmore">
                    <a href="/Home/Story/@Session["Culture"]">@Utility.GetResource.GetResouceValue(Session["Culture"], "lblWatchMore")...</a>
                </div>
            }
        </div>

    </div>
</div>
